/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.demister.sgt.cmd;

/**
 *
 * @author Rock
 */
public class LineCommand extends GraphicsCommand {

    private int x1;
    private int y1;
    private int x2;
    private int y2;

    @Override
    public boolean execute() {
        graphics.drawLine(x1, y1, x2, y2);
        return true;
    }

    @Override
    public String getCode() {
        return String.format("g.drawLine(%d, %d, %d, %d)", x1, y1, x2, y2);
    }
}